package com.hopu.mybatis01.mapper;

import com.hopu.mybatis01.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;

import java.util.List;
//接口写方法

public interface UserMapper {

    /**
     * 查询
     * @return
     */
//    @Select("select *from t_user")
    List<User> select(String username,String password);

    /**
     * 增加
     * @param username
     * @param password
     * @return
     */
//    @Insert("insert  into t_user(username,password)values (#{username},#{password})")
    String insert(String username,String password);

    /**
     * 修改
     * @param id
     * @param username
     * @param password
     * @return
     */
//    @Update("update t_user set username=#{username},password=#{password}where id=#{id}")
    String update(int id,String username,String password);

    /**
     * 删除
     * @param id
     */
//    @Delete("delete from t_user where id=#{id}")
    String delete(int id);

}
